#include "Button.h"

bool Button::Init(RECT a_pos)
{
	TextBox::Init(a_pos);
	iType = BUTTON;

	return true;
}

bool Button::Init()
{
	RECT tempRect;
	tempRect.left = 0;
	tempRect.top =  0;
	tempRect.right = 40;
	tempRect.bottom = 60;

	Init(tempRect);

	return true;
}

bool Button::WasClicked()
{
	// if the cursor is within the text box
	if(DInput::Engine()->mouseXPos() < m_rLocation.right && 
	   DInput::Engine()->mouseXPos() > m_rLocation.left &&
	   DInput::Engine()->mouseYPos() < m_rLocation.bottom &&
	   DInput::Engine()->mouseYPos() > m_rLocation.top)
	{
		if(DInput::Engine()->mouseButtonHit(LEFT_MOUSE_BUTTON))
			return true;
	}

	return false;
};